/* 抽象访问者 */
#pragma once

#include <iostream>
#include <string>

class Apple;
class Book;

class Visitor {
public:
    void setName(std::string name) { name_ = name; }
    virtual void visit(Apple* apple) = 0;
    virtual void visit(Book* book) = 0;

protected:
    std::string name_;
};